/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mscs.server.admin.logic;

import java.util.ArrayList;
import java.util.List;
import mscs.data.IFileDataStore;
import mscs.data.IPersonProxy;
import mscs.data.pojo.Person;

/**
 *
 * @author Administrator
 */
public class SearchPersonUtil  implements ISearchPersonUtil {
    private ArrayList<Person> personList;  		//已有会员列表
    private IFileDataStore fds = new IPersonProxy();
    
    public SearchPersonUtil(){
        personList = (ArrayList<Person>)fds.getObjects();
    }

    public List<Person> searchByName(String name) {
        return this.fds.searchObjectsByAttr("name",".*"+ name+".*");
    }

    public List<Person> searchByID(String id) {
        return this.fds.getObjectsByAttr("id", id);
    }

    public List<Person> searchByLevel(String level) {
        return this.fds.getObjectsByAttr("level", level);
    }

    public List<Person> getAll() {
        return this.fds.searchObjectsByAttr("name", ".*"+""+".*");
    }

   
    
}
